<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateStudyfavsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('studyfavs', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('userid');
            $table->integer('studyid');
            $table->integer('type');
            $table->timestamps();
            $table->unique(['userid', 'studyid', 'type']);
        });
        DB::update('ALTER TABLE studyfavs AUTO_INCREMENT = 3707');
    }


    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('studyfavs');
    }

}
